//默认执行函数
(function () {
    let html = '<a class="navbar-brand" href="#"></a>\n' +
        ' <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">\n' +
        '  <span class="navbar-toggler-icon"></span>\n' +
        ' </button>\n' +
        ' <!-- 功能 -->\n' +
        ' <div class="collapse navbar-collapse" id="navbarSupportedContent">\n' +
        '  <ul class="navbar-nav mr-auto">\n' +
        '   <li class="nav-item ml-3 btn-group-vertical">\n' +
        '    <a class="nav-link" href="../index.html">首页</a>\n' +
        '   </li>\n' +
        '   <li class="nav-item ml-3 btn-group-vertical">\n' +
        '    <a class="nav-link" href="/pages/course.html">课程</a>\n' +
        '   </li>\n' +
        '   <li class="nav-item ml-3 btn-group-vertical">\n' +
        '    <a class="nav-link" href="/pages/news.html">公告</a>\n' +
        '   </li>\n' +
        '   <li class="nav-item ml-3 btn-group-vertical" th:if="${loginUser!=null}">\n' +
        '    <a class="nav-link position-relative" href="/pages/letter.html">消息\n' +
        '     <span class="badge badge-danger" th:text="${allUnreadCount!=0?allUnreadCount:\'\'}">12</span>\n' +
        '    </a>\n' +
        '   </li>\n' +
        '   <li class="nav-item ml-3 btn-group-vertical" th:if="${loginUser==null}">\n' +
        '    <a class="nav-link" href="/pages/register.html">注册</a>\n' +
        '   </li>\n' +
        '   <li class="nav-item ml-3 btn-group-vertical" th:if="${loginUser==null}">\n' +
        '    <a class="nav-link" href="/pages/login.html">登录</a>\n' +
        '   </li>\n' +
        '   <li class="nav-item ml-3 btn-group-vertical dropdown" th:if="${loginUser!=null}">\n' +
        '    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n' +
        '     <img src="module/img/2.jpg" class="rounded-circle"  style="width:30px;"/>\n' +
        '    </a>\n' +
        '    <div class="dropdown-menu" aria-labelledby="navbarDropdown">\n' +
        '     <a class="dropdown-item text-center" href="/pages/profile.html">个人主页</a>\n' +
        '     <a class="dropdown-item text-center" href="/pages/setting.html">账号设置</a>\n' +
        '     <a class="dropdown-item text-center" href="/pages/logout.html">退出登录</a>\n' +
        '     <div class="dropdown-divider"></div>\n' +
        '     <span class="dropdown-item text-center text-secondary" th:utext="${loginUser.username}">nowcoder</span>\n' +
        '    </div>\n' +
        '   </li>\n' +
        '   <li class="nav-item ml-3 btn-group-vertical">\n' +
        '    <a class="nav-link" id="btnSign" title="每日签到">\n' +
        '     <button class="btn btn-primary btn-sm position-absolute rt-0" id="signIn">签到</button></a>\n' +
        '   </li>\n' +
        '  </ul>\n' +
        '  <!-- 搜索 -->\n' +
        '  <form class="form-inline my-2 my-lg-0" method="get" th:action="@{/search}">\n' +
        '   <input class="form-control mr-sm-2" type="search" aria-label="Search" name="keyword" th:value="${keyword}"/>\n' +
        '   <button class="btn btn-outline-light my-2 my-sm-0" type="submit">搜索</button>\n' +
        '  </form>\n' +
        ' </div>';
    $("#nav").html(html);
})();